package se.webbzon.boltzmann.game.sequence.condition;

import se.webbzon.boltzmann.game.sequence.Sequence;
import se.webbzon.boltzmann.game.sequence.Sequences;

public class IsLesserOrEqualCondition extends ConditionSequenceNode {
	
	/*============================================================
	Constructors
	============================================================*/

	public IsLesserOrEqualCondition(Sequence sequence, String lh, String rh) {
		super(sequence,lh,rh);
	}
	
	/*============================================================
	Public Methods
	============================================================*/

	@Override public boolean isTrue() {
		Sequence seq = getSequence();
		Double lh = (Double) Sequences.parse(seq, getLeftHandArgument());
		Double rh = (Double) Sequences.parse(seq, getRightHandArgument());
		return lh <= rh;
			
	}

}
